/*
 * SDLEventCallback.h
 *
 *  Created on: Aug 6, 2010
 *      Author: Ry
 */

#ifndef SDLEVENTCALLBACK_H_
#define SDLEVENTCALLBACK_H_

#include <SDL/SDL_events.h>
#include "event/ClassCallback.h"
#include "SDLEventHandler.h"

template <class T> class SDLEventCallback: public SDLEventHandler {
private:
	ClassCallback<T, SDL_Event> *callback;
public:
	SDLEventCallback(T* target, void (T::*callback)(SDL_Event, float)) {
		this->callback = new ClassCallback<T, SDL_Event>(target, callback);
	}

	void handleEvent(float dts) {
		callback->handleEvent(event, dts);
	}

	virtual ~SDLEventCallback(){
		delete callback;
	};
};

#endif /* SDLEVENTCALLBACK_H_ */
